package com.suixun.service.mongodb;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Service;
import com.suixun.dao.mongodb.*;
import com.suixun.entity.mongodb.*;
import com.suixun.util.db.MongoDBPagination;

@Service("appVersionService")
public class AppVersionService {

    @Resource
	private AppVersionDao appVersionDao;

	public AppVersion findByid(int id) {
		return appVersionDao.findById(id);
	}

	public AppVersion findOne(Map<String, String> params) {
		return this.appVersionDao.findOne(params);
	}
	
	public List<AppVersion> find(Query query) {
        return this.appVersionDao.find(query);
    }
	
	public AppVersion save(AppVersion bean) {
		return appVersionDao.save(bean);
	}

	public MongoDBPagination<AppVersion> getPageArticle(int pageNo, int pageSize) {
		return appVersionDao.getPageArticle(pageNo, pageSize);
	}

	/**
	 * 暂时只是固定去修改,会有下一篇博客,写高级修改...
	 */
	public void update(String id, Map<String, String> params) {
		this.appVersionDao.updateEntity(id, params);
	}
	
	public AppVersion findAndRemove(Query query) {
        return this.appVersionDao.findAndRemove(query);
    }
	
	public AppVersion findAndModify(Query query, Update update) {

        return this.appVersionDao.findAndModify(query, update);
    }
}
